<?php
$host = "0.0.0.0";
$port = 9501;
$server = new swoole_http_server($host,$port);
$server->on('request',function($request,$response){
    $response->header("Content-Disposition","attachment;filename=". date('YmdHis'));
    $file = __FILE__;
    $response->sendfile($file);
});
$server->start();